package cn.cloud.butler.webapi.controller;

import cn.cloud.butler.webapi.domain.AppExceptionLogEntity;
import cn.cloud.butler.webapi.domain.ResponseEntityNoData;
import cn.cloud.butler.webapi.service.AppExceptionLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * All rights Reserved,Designed By TangYue
 *
 * @author: 汤越
 * @date: 2019/8/1 16:30
 * @copyright: @2019
 */
@RestController

@EnableAutoConfiguration
@RequestMapping("/HncWeb")
public class AppExceptionLogController {

    @Autowired
    AppExceptionLogService appExceptionLogService;

    @RequestMapping(method = RequestMethod.POST,value = "/AddAppException.action")
    public void AddAppException(String createTime,String fingerPrint,String phoneNumber,String versionInfo,String value) {
        ResponseEntityNoData responseEntityNoData = new ResponseEntityNoData();
        Integer result = appExceptionLogService.Add(createTime,fingerPrint,phoneNumber,versionInfo,value);
        if(result<=0){
            responseEntityNoData.setMsgCode(1);
            responseEntityNoData.setMsgDesc("插入失败");
        }else{
            responseEntityNoData.setMsgCode(0);
            responseEntityNoData.setMsgDesc("插入成功");
        }
    }

}
